/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.xepf.utils;

/**
 * Usage related methods that are part of all edtf applications.
 */
public class Usage {

    public static String getStartupBanner(String application, String version, String releaseDate) {
        StringBuilder banner = new StringBuilder(500);
        String lineSeparator = Sys.getProperty("line.separator");
        banner.append("---------------------------------------" + lineSeparator);
        banner.append(" Event driven testing framework - edtf" + lineSeparator);
        banner.append(" http://code.google.com/p/edtf" + lineSeparator);
        banner.append(" " + application + " " + version + ", " + releaseDate + lineSeparator);
        banner.append("---------------------------------------" + lineSeparator);
        return banner.toString();
    }

    public static String getBuildInfo() {
        // todo: store these info in buildInfo.xml and read them here
        StringBuilder buildInfo = new StringBuilder(200);
        String lineSeparator = Sys.getProperty("line.separator");
        //banner.append("--- BUILD.REVISION:           ---" + lineSeparator);    // todo using ant
        buildInfo.append("--- BUILD.DATE: " + DateUtils.getDate("yyyy.MM.dd hh:mm:ss a, z") + "        ---" + lineSeparator);
        buildInfo.append("--- BUILD.OS:   "
                + Sys.getProperty("os.name") + ", "
                + Sys.getProperty("os.arch") + ", "
                + Sys.getProperty("os.version") + " ---" + lineSeparator);
        buildInfo.append("--- BUILD.JAVA: "
                + Sys.getProperty("java.vendor") + ", "
                + Sys.getProperty("java.version") + "      ---" + lineSeparator);
        return buildInfo.toString();
    }
}